package com.dayang.schedule;

import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import javax.annotation.Resource;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;


public class SurvivingCheckSchedule {
	private static final Logger logger = LogManager
			.getLogger(SurvivingCheckSchedule.class);
    private boolean flag = false;
	
	@Resource
	private RedisUtil redisUtil;

	/**
	 * 扫描处理直播中的直播信息，判断该直播是否出现了问题
	 */
	public void handleLiving() {
		logger.info("处理事务开始......");
		
		
	/*	try {
			if(!this.isFlag()){
				logger.info("清空redis数据库开始...");	
				redisUtil.flushDB();
				this.setFlag(true);
				logger.info("清空redis数据库结束...");		
				
			}else{
				
				logger.info("处理事务结果......"+redisUtil.get("112"));	
				
				
			}
			
			
			
			
		} catch (Exception e) {
			StringWriter sw = new StringWriter();
			e.printStackTrace(new PrintWriter(sw));
			// response.setCode(404);
			// response.setInfo("处理失败！");
			logger.info("处理结果失败：" + sw);
		} finally {
		
		}*/

		logger.info("处理事务结束......");

	}

	public boolean isFlag() {
		return flag;
	}

	public void setFlag(boolean flag) {
		this.flag = flag;
	}

}
